package com.kaka.bus.util;

import android.text.TextUtils;

import com.kaka.bus.api.RetrofitUtils;
import com.kaka.bus.manager.T;

import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;

/**
 * Created by zhangqi on 2017/11/22.
 */

public class DrainageEvent {

    public static void event(String per_id, String drainage_id, int event, CompositeDisposable compositeSubscription){
        if(TextUtils.isEmpty(per_id)){
            per_id = "0";
        }
        Disposable subscribe = RetrofitUtils.getInstance().build()
                .drainageEvent(per_id, drainage_id, event)
                .compose(T.D())
                .subscribe();

        if(compositeSubscription != null){
            compositeSubscription.add(subscribe);
        }
    }
}
